home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 6 / coreaids.zip / CHG_DIR.ASM < prev    next >
Assembly Source File  |  1987-06-25  |  821b  |  37 lines

  1. ;    DESC:    Changes to a new directory using the path provided   V1.00
  2. ;    IN:    *{SEG_VAL} segment  and
  3. ;        *{OFFSET} offset of path string
  4. ;    SAMPLE:    Callm    CHG_DIR,<SEG_VAL,OFFSET>,
  5. ;    ##################################################################
  6.  
  7.     Extrn    PUSHALL:Near
  8.     Extrn    POPALL:Near
  9.     Extrn    ERRORMSG:Near
  10.  
  11. CHG_DIRC    Segment
  12.     Assume    CS:CHG_DIRC
  13.     Public    CHG_DIR
  14.  
  15.                         ;notice.
  16.     DB    'CHG_DIR  - V1.00, Copyright 1987, CoreTechs   ',0DH,0AH
  17.  
  18. CHG_DIR    Proc    Near                ;changes to a new directory.
  19.     Call    PUSHALL
  20.  
  21.     Pop    DX                ;get the filename offset.
  22.     Pop    DS                ;get the segment offset.
  23.  
  24.     Mov    AH,3BH                ;change to a new directory.
  25.     Int    21H
  26.     Jc    ERROR                ;if error occurs, report it.
  27.  
  28.     Call    POPALL
  29.     Ret
  30.  
  31. ERROR:    Push    AX                ;report error any and abort.
  32.     Call    ERRORMSG
  33.  
  34. CHG_DIR    Endp
  35. CHG_DIRC    Ends
  36.     End
  37.